
<div class="mod-project project-manage">
  <div class="project-options">
    <button ui-sref="createProject/1" class="ui-btn ui-btn-lg"><i class="icon-add-white"></i>创建新项目</button>
    <div class="pull-right"><span ng-cloak="ng-cloak">共{{filteredProjectList.length}}个项目</span>
      <input type="text" placeholder="输入项目名称查询" ng-model="proKeywards" class="ui-input-search ui-input-fill"/>
    </div>
  </div>
  <div class="mod-list">
    <loading ng-if="isLoading"></loading>
    <table class="ui-table-dome">
      <thead>
        <tr>
          <th>项目名称</th>
          <th>构建时间</th>
          <th>构建状态</th>
          <th>代码源</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-if="filteredProjectList.length===0">
          <td colspan="6" class="text-center">暂无相关项目</td>
        </tr>
        <tr ng-repeat="project in filteredProjectList =  (projectList|filter:{name:proKeywards})">
          <td><a ng-bind="project.name" ui-sref="projectDetail({'project':project.id})"></a></td>
          <td ng-bind="parseDate(project.buildTime)"></td>
          <td ng-switch="project.buildStatus"><span ng-switch-when="Success" class="txt-success">成功</span><span ng-switch-when="Fail" class="txt-warning">失败</span><span ng-switch-when="Building" class="txt-normal">构建中</span><span ng-switch-when="Preparing" class="txt-normal">准备中</span><span ng-switch-when="Send" class="txt-normal">准备中</span><span ng-switch-default="ng-switch-default">未启动</span></td>
          <td ng-cloak="ng-cloak" ng-switch="project.codeManager"><span ng-if="!project.nameWithNamespace">无</span><a href="{{project.codeHttpUrl}}" target="_blank" ng-show="project.nameWithNamespace"><i ng-switch-when="gitlab" class="icon-gitlab"></i><i ng-switch-when="github" class="icon-github"></i>{{project.nameWithNamespace}}</a></td>
          <td>
            <button ng-click="openBuild(project.id,!!project.nameWithNamespace)" class="ui-btn ui-btn-sm ui-btn-safe">构建</button>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>